# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=morph-browser
pkgver=1.0.3
pkgrel=1
pkgdesc="Lightweight web browser tailored for Ubuntu Touch"
url="https://gitlab.com/ubports/development/core/morph-browser"
# armhf: blocked by lomiri-ui-toolkit
# ppc64le/riscv64/s390x: blocked by qt5-qtwebengine
arch="all !armhf !ppc64le !riscv64 !s390x"
license="GPL-3.0-only"
depends="
	font-liberation
	lomiri-action-api
	lomiri-content-hub
	lomiri-ui-extras
	lomiri-ui-toolkit
	qt5-qtbase-sqlite
	qt5-qtquickcontrols2
	"
makedepends="
	click-dev
	cmake
	cmake-extras
	gnome-desktop-dev
	libapparmor-dev
	lomiri-trust-store-dev
	qt5-qtdeclarative-dev
	qt5-qtwebengine-dev
	samurai
	xvfb-run
	"
checkdepends="
	py3-dbusmock
	py3-xdg
	"
subpackages="$pkgname-lang"
source="https://gitlab.com/ubports/development/core/morph-browser/-/archive/$pkgver/morph-browser-$pkgver.tar.gz"
options="!check" # 4 tests fail and test 27 hangs

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DCLICK_MODE=off
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
86259b2ae604bce36e20ea219c07bd9d0d6c089bc42b13e82fee558d484cf7dd8818e3d53c538c8868af64e2a6f17082ae8faa26787f4ab0a9f56e37a62a2153  morph-browser-1.0.3.tar.gz
"
